package com.group9.handinhand.service.so;

import org.apache.commons.lang.ArrayUtils;

import com.group9.handinhand.dao.model.RequestResponse;
/**
 * Class for service of request response
 *
 */
public class RequestResponseSO extends AbstractBaseSO {
	
    private RequestSO request;
	private UserSO user;
	private int respondAmount;
	/**
	 * converts request response model object
	 * @param ignoreProperties
	 * @return
	 */
	public RequestResponse convertToModelObject(String... ignoreProperties) {
		RequestResponse model = (RequestResponse) convert(new RequestResponse(),
				(String[]) ArrayUtils.addAll(ignoreProperties,new String[]{"request","user"}));
		model.setUser(this.user.convertToModelObject());
		model.setRequest(this.request.convertToModelObject(new String[]{"moderators", "posts"}));
		return model;
	}

	public RequestSO getRequest() {
		return request;
	}

	public void setRequest(RequestSO request) {
		this.request = request;
	}

	public UserSO getUser() {
		return user;
	}

	public void setUser(UserSO user) {
		this.user = user;
	}

	public int getRespondAmount() {
		return respondAmount;
	}

	public void setRespondAmount(int respondAmount) {
		this.respondAmount = respondAmount;
	}

	@Override
	public String toString() {
		return "RequestResponseSO [request=" + request + ", user=" + user
				+ ", respondAmount=" + respondAmount + "]";
	}

	
	
}
